﻿

//设置画面大小
var screenWidth = 800;
var screenHeight = 600;

/* 图片src对象 */
var srcObj = {
    FormBgSrc: "images/ui/wint.jpg",
    Btn0101: "images/btn0.png",
    Btn0102: "images/btn1.png",
    Btn0103: "images/btn2.png",
    Ct01bg: "images/bg/cy_gdc.jpg",
    Wd01bg: "images/bg/wd_wd1.jpg",
    GameMapBg: "images/bg/BigMaps.jpg",
    BagBg: "images/ui/BagBg.png",
    CtPulubg: "images/bg/pulu.png",
    ShopItemsBg:"images/ui/ShopItems.png",
}

//初始化游戏
function game_init() {
    //初始化引擎
    F5Frame.init();
    //加载资源
    F5Frame.loader.start([srcObj.FormBgSrc,srcObj.Btn0101,srcObj.Btn0102,srcObj.Btn0103,srcObj.Ct01bg,
        srcObj.Wd01bg, srcObj.GameMapBg, srcObj.BagBg, srcObj.CtPulubg, srcObj.ShopItemsBg],maryGame);
}
//资源加载完成调用
function maryGame(){
    //初始化游戏UI
    init_game_ui();

    //加载游戏信息
    init_game_info();
}

//初始化游戏UI
function init_game_ui() {
    //**************游戏UI
    GF_SceneMgr.init();
    GF_GameMain.init();
    
    GF_PlayerInfo.init();
    GF_City.init();
    GF_Wild.init();
    GF_Bags.init();
    GF_ShopItems.init();
    EventDrama.init();

    //show_msgsss();
}

//加载游戏信息
function init_game_info() {
    //获取人物信息
    ajaxMsg(MsgEvent.PInfo, null);

    //获取场景信息
    ajaxMsg(MsgEvent.SceneInfo, null);
}

/** 生成一个子窗口
*/
var framemaps = new MapClass();
var iframe = 0;
//生成一个母模型为_MoveForm的页面
function newForm(url) {
    iframe += 1;

    var newframe = document.createElement("iframe");
    var idn = "moveform" + iframe;
    newframe.id = idn;
    newframe.setAttribute("src", "Game/ShowForm/?url=" + url + "&fname=" + idn);

    document.body.appendChild(newframe);

    framemaps.add(iframe, newframe);
}
